﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace KD.Sms.UI_Query
{
    public partial class frmFault : Form
    {
        public frmFault()
        {
            InitializeComponent();
        }



        private void frmSamplingInfo_Load(object sender, EventArgs e)
        {
            dtBegin.Value = DateTime.Now.AddDays(-1);
            dtEnd.Value = DateTime.Now.AddDays(1);
        }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tools_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
        {
            if(e.Tool.Key=="Query")
                gridMain.DataSource = DAL.SqlLite.Main.Instance.DoQueryFault(txtContent.Text.Trim(), dtBegin.Value.ToString("yyyy-MM-dd HH:mm:ss"), dtEnd.Value.ToString("yyyy-MM-dd HH:mm:ss"));
        }

        private void frmFault_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Escape) this.Close();
        }
    }
}
